<template>
	<view class="login-page">
		<view class="login-page-logo">
			<u-image src="@/static/image/logo3.png" mode="" width="160rpx" height="160rpx"></u-image>
			<view style="width: 30rpx; height: 20rpx;"></view>
			<u-image src="@/static/image/logo4.png" mode="" width="260rpx" height="120rpx"></u-image>
		</view>

		<button open-type="getPhoneNumber" @getphonenumber="getPhoneNumber" class="login-page-btn">
			同意授权
		</button>

	</view>
</template>

<script>
	export default {
		data() {
			return {
				openId: ''
			}
		},
		onShow() {
			const userInfo = uni.getStorageSync('userInfo')
			console.log(userInfo)
			this.openId = userInfo.openId
		},
		methods: {
			getPhoneNumber(data) {
				this.$u.api
					.postKsPhone({
						...data.detail,
						openId: this.openId
					}).then(res => {
						this.login().then(() => {
							uni.reLaunch({
								url: '/pages/index/index'
							})
						})

					})
			}
		}
	}
</script>

<style lang="scss" scoped>
	.login-page {
		width: 100vw;
		height: 100vh;
		// background-image: linear-gradient(45deg, #FFFEFF 0%, #D7FFFE 100%);
		background-image: linear-gradient(45deg, #FFFEFF 0%, #D7FFFE 70%, #D7FFFE 100%);
		padding-top: 10vh;
	}

	.login-page-logo {
		display: flex;
		align-items: center;
		justify-content: center;
	}

	.login-page-btn {
		background-color: #3D9C9A;
		width: 70vw;
		height: 90rpx;
		border-radius: 45rpx;
		box-sizing: border-box;
		box-shadow: 0px 0px 9px -2px #3D9C9A;
		color: #FFFEFF;
		margin-top: 8vh;
	}
</style>